package main

func main() {
	CalSquare()
}
func CalSquare() {
	src := make(chan int)
	dest := make(chan int,3)
	go func(){
		defer close(src)
		for i := 0;i<10;i++{
			src <- i
		}
	}()
	go func() {
		defer close(dest)
		for i := range src {
			dest <- i * i
		}
	}()
	for i:= range dest {
		println(i)
	}
}